package com.itheima.springboot_condition.config;

import com.itheima.springboot_condition.condition.UserConditional;
import com.itheima.springboot_condition.condition.UserConditionalet;
import com.itheima.springboot_condition.domain.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserConFig {
    @Bean
    //使用Conditional来判断返回的值是什么,如果是false,则不让它获取bean
    //需要自定义一个类
    //@Conditional(UserConditional.class)//由于现在返回的是false,所以这个User不能被读取
    @UserConditionalet("redis.clients.jedis.Jedis")
    public User user(){
        return new User();
    }
}
